package com.snail.model.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author cici
 * @description 作品实体
 * @date 2025/8/19 14:08
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
@Document(indexName = "biz_work")
public class Work {
    @Id
    //keyword类型：不进行分词，直接存储
    @Field(name="id", type = FieldType.Keyword)
    @JsonProperty("id")
    private Integer id;
    @Field(name="id", type = FieldType.Byte)
    @JsonProperty("user_id")
    private Integer userId;
    @Field(name="works_name", type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    @JsonProperty("works_name")
    private String worksName;
    @Field(name="cover_file_url", type = FieldType.Text)
    @JsonProperty("cover_file_url")
    private String coverFileUrl;
    @Field(name="description", type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    @JsonProperty("description")
    private String description;
    @Field(name="tags", type = FieldType.Text)
    @JsonProperty("tags")
    private String tags;
    @Field(name="is_charge", type = FieldType.Text)
    @JsonProperty("is_charge")
    private String isCharge;
    @Field(name="price", type = FieldType.Text)
    @JsonProperty("price")
    private String price;
    @Field(name="create_time", type = FieldType.Text)
    @JsonProperty("create_time")
    private String createTime;
    @Field(name="update_time", type = FieldType.Text)
    @JsonProperty("update_time")
    private String updateTime;
}
